/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.fundacionincap.VO;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author langeblanc
 */
@Entity
@Table(name = "salon", catalog = "AsignacionCarga", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Salon.findAll", query = "SELECT s FROM Salon s"),
    @NamedQuery(name = "Salon.findByNumeroSalon", query = "SELECT s FROM Salon s WHERE s.numeroSalon = :numeroSalon"),
    @NamedQuery(name = "Salon.findByDescripcion", query = "SELECT s FROM Salon s WHERE s.descripcion = :descripcion")})
public class Salon implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "numeroSalon")
    private String numeroSalon;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "salon")
    private Collection<Horario> horarioCollection;

    public Salon() {
    }

    public Salon(String numeroSalon) {
        this.numeroSalon = numeroSalon;
    }

    public Salon(String numeroSalon, String descripcion) {
        this.numeroSalon = numeroSalon;
        this.descripcion = descripcion;
    }

    public String getNumeroSalon() {
        return numeroSalon;
    }

    public void setNumeroSalon(String numeroSalon) {
        this.numeroSalon = numeroSalon;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    @XmlTransient
    public Collection<Horario> getHorarioCollection() {
        return horarioCollection;
    }

    public void setHorarioCollection(Collection<Horario> horarioCollection) {
        this.horarioCollection = horarioCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (numeroSalon != null ? numeroSalon.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Salon)) {
            return false;
        }
        Salon other = (Salon) object;
        if ((this.numeroSalon == null && other.numeroSalon != null) || (this.numeroSalon != null && !this.numeroSalon.equals(other.numeroSalon))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.edu.fundacionincap.VO.Salon[ numeroSalon=" + numeroSalon + " ]";
    }
    
}
